package com.yaozheng.vocationaltraining.view.question.item;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import com.yaozheng.vocationaltraining.adapter.paper.ItemQuestionListAdapter;
import com.yaozheng.vocationaltraining.adapter.paper.OnCancelSelect1;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;


/**
 * Created by xiaoqing on 2016/6/2.
 */
public abstract class ItemBaseQuestionView extends LinearLayout {
    protected String answerCode;
    protected JSONObject itemData;
    /**
     * 取消选中
     */
    protected OnCancelSelect1 onCancelSelect;


    public ItemBaseQuestionView(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
    }

    public ItemBaseQuestionView(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }

    /**
     * 设置position
     *
     * @param position
     */
    public void setPosition(int position) {

    }

    public void setOnCancelSelect(OnCancelSelect1 onCancelSelect) {
        this.onCancelSelect = onCancelSelect;
    }

    /**
     * 设置选项内容
     *
     * @param optionsContent 选项内容
     */
    public abstract void setOptionsContent(String optionsContent);

    /**
     * 提示
     *
     * @param optionsCard
     */
    public abstract void optionsCard(JSONArray optionsCard);

    /**
     * 答案核心
     */
    public void setAnswerCode(String answerCode) {
        this.answerCode = answerCode;
    }

    /**
     * 设置一项
     *
     * @param itemData
     */
    public void setItemData(JSONObject itemData) {
        this.itemData = itemData;
    }

    /**
     * 取消选中
     */
    public void cancelSelect() {
    }

    /**
     * 设置答案
     *
     * @param answer
     */
    public abstract void setAnswer(String answer);

    /**
     * 答案改变
     *
     * @author Administrator
     */
    public static interface OnAnswerChange {
        public void answerChange(ItemBaseQuestionView baseQuestionView);
    }
}
